import Vue from 'vue'
import Router from 'vue-router'
import Hello from "@/components/Hello";
import Vantcoms from "@/components/Vantcoms";
import TabbarComs from "../components/TabbarComs";
import HomePage from "../components/HomePage";
import Order from "../components/Order";

Vue.use(Router)

export default new Router({
  mode: 'hash',
  routes: [
    {//设置默认的访问的路径
      path: '/',
      name: '主页',
      redirect: 'hello'
    },
    {
      path: '/hello',
      name: 'hello',
      component: resolve => require(['@/components/Hello'], resolve)
    },
    {
      path: '/vantcoms',
      name: 'vantcoms',
      component: resolve => require(['@/components/Vantcoms'], resolve)
    },
    {
      path: '/order',
      name: 'order',
      component: Order
    },
    {
      path: '/tabbarComs',
      name: 'tabbarComs',
      component: TabbarComs
    },
    {
      path: '/homePage',
      name: 'homePage',
      component: resolve => require(['@/components/HomePage'], resolve)
    },
    {
      path: '/carDetailPage',
      name: 'carDetailPage',
      component: resolve => require(['@/components/CarDetailPage'], resolve)
    },
    {
      path: '/login',
      name: 'login',
      component: resolve => require(['@/components/user/Login'], resolve)
    },
    {
      path: '/register',
      name: 'register',
      component: resolve => require(['@/components/user/Register'], resolve)
    },
    {
      path: '/orderDetailPage',
      name: 'orderDetailPage',
      component: resolve => require(['@/components/order/OrderDetailPage'], resolve)
    }
  ],
  // proxyTable: {
  //   '/jj': {
  //     target: 'http://192.168.137.1:8787/', //测试线
  //     changeOrigin: true, // 是否跨域
  //     pathRewrite: {
  //       '^/jj': '/jj'
  //     }
  //   }
  // }
})
